<template>
	<view class="block">
		<view class="title">{{getList.shareName}}</view>
		<view class="secend">
			<view class="tab">
				<view v-for="(item,index) in tags" :key="index">
					<view class="margin-left 30rpx">{{item}}</view>
				</view>
			</view>
			<image class="collection" src="../../static/shoucang-no.png" v-show="showUpImg" @click="changeImg" mode="heightFix"></image>
			<image class="collection" src="../../static/shoucang-y.png" v-show="!showUpImg" @click="changeImg" mode="heightFix"></image>
			<image class="collection1" src="../../static/fenxiang-n.png" mode="heightFix"></image>
		</view>
		<view class="box">
			<text class="text">{{getList.shareContent}}</text>
			<image class='tu' mode="widthFix" :src='getList.imageUrl'></image>
		</view>
		<view class="info">
<!-- 			<view>所在学院 ：</view>
			<view>专业方向 ：</view> -->
			<view>联系方式 ：{{getList.contactInfo}}</view>
<!-- 			<view>所在行业 ：</view> -->
			<view>工作地点 ：{{getList.cityName}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				getList:[],
				tags:[],
				showUpImg:true,
				
			}
		},
		onLoad(e) {
			console.log("帖子传参",e)
			if(e.navIndex==0){
				uni.request({
					url:"https://hotenergy.club/workapp/share/get_all",
					method:"GET",
					data:"",
					success:(res)=>{
						//console.log(res.data[e.index]);
						this.getList=res.data[e.index];
						this.tags=res.data[e.index].tags;
						console.log(res.data[e.index].tags);
					},
				})			
			}
			if(e.navIndex==1){
				uni.request({
					url:"https://hotenergy.club/workapp/share/get_all_tag1",
					method:"GET",
					data:"",
					success:(res)=>{
						console.log(res.data[e.index]);
						this.getList=res.data[e.index];
						this.tags=res.data[e.index].tags;
						console.log(res.data[e.index].tags);
					},
				})			
			}
			if(e.navIndex==2){
				uni.request({
					url:"https://hotenergy.club/workapp/share/get_all_tag2",
					method:"GET",
					data:"",
					success:(res)=>{
						//console.log(res.data[e.index]);
						this.getList=res.data[e.index];
						this.tags=res.data[e.index].tags;
						console.log(res.data[e.index].tags);
					},
				})			
			}
		},
		methods: {
			changeImg:function(){
				this.showUpImg = !this.showUpImg
			},
		}
	}
</script>

<style>
.block{
	position:relative;//定位方式,相对定位
	margin: 5rpx 25rpx 25rpx 25rpx;
	padding: 3%;
}
.title{
	font-size: large;
	font-weight:600;
	position:relative;//定位方式,相对定位
	margin-bottom: 30rpx;
}
.tab{
	position:relative;//定位方式,相对定位
	margin-bottom: 30rpx;
	background-color: #666FFC;
	border-radius: 15rpx;
	width: 180rpx;
	color: #FFFFFF;
	display: block;//块的形式让文字居中
	text-align: center;
}
.info{
	position:relative;//定位方式,相对定位
	margin-top: 50rpx;
	margin-bottom: 100rpx;
	border-top: 1px solid #ccc;
	background-color: #FFFFFF;
	display: flex;
	flex-direction: column;
	color: #8a8a8a;
	height: 100rpx;
}
.box{
	padding: 2%;
}
.text{
	line-height: 1.6;
	text-indent:2em;
	color: #555555;
}
.collection{
	margin-left: 380rpx;
	height: 50rpx;
	/* margin: 20rpx 0 0 120rpx; */
}
.collection1{
	margin-top: 5rpx;
	margin-left: 20rpx;
	height: 40rpx;
	/* margin: 20rpx 0 0 120rpx; */
}
.secend{
	display: flex;
	flex-direction: row;
}
.tu{
	display: flex;
	justify-content: center;
	max-width: 600rpx;
}
</style>
